<include file="Public:header" />
<div class="cont_main"> 
    <!---->
    <!---->
    <div class="uc_right">
        <div class="ucright_info_box">
            <h3 class="reg_tit">修改密码</h3>
            <ul class="into_info_box">
                <li><span class="reg_name_box">新密码：</span><span>
                        <input type="password" class="reg_inp" id='newpass'>
                    </span></li>
                <li><span class="reg_name_box">确认新密码：</span><span>
                        <input type="password" class="reg_inp" id='renpass'>
                    </span></li>
                    <input type="hidden" name='username' id='username' value='<!--{$username}-->'/>
                <li><span class="rl_btn_warp margin_20">                        
                               <a button class="public_img into_btn" href='javascript:void(0)' onclick='uppass()'>确认修改</a>
                    </span> </i>
            </ul>
        </div>
    </div>
</div>
<script type="text/javascript">
    function uppass() {
        var newpass = $("#newpass").val();
        var renpass = $("#renpass").val();
        var username= $("#username").val();
        
        if (newpass == '' || renpass == '') {
            alert("密码不能为空！");
            return;
        }
        if (newpass != renpass) {
            alert("两次密码输入不一至");
            return;
        }
        $.ajax({
            type: 'get',
            url: domain + '/index.php?s=/get/uppass',
            data: {'newpass': newpass, 'renpass': renpass,"username":username},
            dataType: 'json',
            success: function (data) {
                if (data['ret'] == 0) {
                    alert(data['msg']);
                    window.location.href = domain;
                } else {
                    alert(data['msg']);
                    return;
                }
            }
        });
    }
</script>
<!---->
<include file="Public:footer" />
